package org.pricejd.calibration;
import josx.platform.rcx.Motor;
import josx.robotics.TimingNavigator;

/**
 * @author wjpj
 * 
 * Once you are calibrated, you can run this test to verify that you are 
 * calibrated correctly.  What happens?  The robot will travel in a square
 * that has sides length of 20 cm.  You should end back up at where you
 * started after 4 90 degree turns.
 */
public class TestCalibration {
	private static final int MOTOR_A_SPEED = 7;
	private static final int MOTOR_C_SPEED = 7;
	private static final float ONE_METER_TIME = 3.705f;
	private static final float ROTATE_ONE_TIME = 2.606f;
	
	public static void main(String args[]) {
		Motor.A.setPower(MOTOR_A_SPEED);
		Motor.C.setPower(MOTOR_C_SPEED);
		
		TimingNavigator tn = new TimingNavigator(Motor.C, Motor.A, 
				ONE_METER_TIME,	ROTATE_ONE_TIME);
		
		// First rotate 360 degrees
		tn.rotate(360);
		
		// Then make the square
		tn.gotoPoint(20,0);
		tn.gotoPoint(20,20);
		tn.gotoPoint(0,20);
		tn.gotoPoint(0,0);
	}
}
